package com.atguigu4.Exercise2;

import java.io.IOException;
import java.io.InputStream;
import java.sql.DriverManager;
import java.util.Properties;

import org.junit.Test;

import com.mysql.jdbc.Connection;

public class ExerciseTest1 {
	@Test
	public void test() throws Exception
	{
		InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("jdbc.properties");
		Properties pr = new Properties();
		pr.load(is);
		String user = pr.getProperty("user");
		String password = pr.getProperty("password");
		String url = pr.getProperty("url");
		String driverClass = pr.getProperty("driverClass");
		Class.forName(driverClass);
		Connection conn = (Connection) DriverManager.getConnection(url,user,password);
		System.out.println(conn);
	}

	
	
}
